﻿<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 9" />
<title>Step 1 - New Project</title>
<link rel="StyleSheet" href="default.css" type="text/css" />
<style type="text/css">
/*<![CDATA[*/
<!--
P { margin-left:0pt;
margin-right:0pt;
font-family:Verdana;
margin-bottom:3pt;
margin-top:18pt; }
H1 { font-weight:bold;
margin-top:14pt;
margin-bottom:14pt;
margin-left:0pt;
margin-right:0pt;
page-break-after:avoid;
font-family:Verdana;
x-next-type:P;
font-size:18pt; }
H2 { font-weight:bold;
margin-top:14pt;
margin-bottom:14pt;
margin-left:0pt;
margin-right:0pt;
page-break-after:avoid;
font-family:Verdana;
x-next-type:P;
font-size:14pt; }
H3 { font-weight:bold;
margin-top:14pt;
margin-bottom:14pt;
margin-left:0pt;
margin-right:0pt;
page-break-after:avoid;
font-family:Verdana;
x-next-type:P;
font-size:12pt; }
-->
/*]]>*/
</style>

<script type="text/javascript" language="JavaScript">
//<![CDATA[
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
        origWidth = innerWidth;
        origHeight = innerHeight;
        onresize = reDo;
}
onerror = null; 
//]]>
</script>
<style type="text/css">
/*<![CDATA[*/
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }
-->
/*]]>*/
</style>

<script type="text/javascript" language="javascript1.2" src="whmsg.js">
</script>
<script type="text/javascript" language="javascript" src="whver.js">
</script>
<script type="text/javascript" language="javascript1.2" src="whproxy.js">
</script>
<script type="text/javascript" language="javascript1.2" src="whutils.js">
</script>
<script type="text/javascript" language="javascript1.2" src="whlang.js">
</script>
<script type="text/javascript" language="javascript1.2" src="whtopic.js">
</script>
</head>
<body>
<script type="text/javascript" language="javascript1.2">
//<![CDATA[
<!--
if (window.gbWhTopic)
{
        var strUrl = document.location.href;
        var bc = 0;
        var n = strUrl.toLowerCase().indexOf("bc-");
        if(n != -1)
        {
                document.location.href = strUrl.substring(0, n);
                bc = strUrl.substring(n+3);
        }

        if (window.addTocInfo)
        {
        addTocInfo("Development\nServer\nStep 1 - New Project");
addButton("show",BTN_TEXT,"Show","","","","",0,0,"","","");

        }
        if (window.writeBtnStyle)
                writeBtnStyle();

        if (window.writeIntopicBar)
                writeIntopicBar(1);

        
        document.write("<p style=\"font-family: Arial; font-size: 8pt; font-weight: 400;  font-style:normal; color: rgb(0, 0, 255); text-decoration:none; text-align: right\"> ");
AddMasterBreadcrumbs("index.htm", "font-family: Arial; font-size: 8pt; font-weight: 400;  font-style:normal; color: rgb(0, 0, 255); text-decoration:none; text-align: right", "&gt;", "Home", "welcome.htm");
document.write("<a style=\"font-family: Arial; font-size: 8pt; font-weight: 400;  font-style:normal; color: rgb(0, 0, 255); text-decoration:none; text-align: right\" href=\"developing_ua_applications.htm\">Development<\/a> &gt; <a style=\"font-family: Arial; font-size: 8pt; font-weight: 400;  font-style:normal; color: rgb(0, 0, 255); text-decoration:none; text-align: right\" href=\"server_development.htm\">Server<\/a> &gt; Step 1 - New Project<\/p>");


        if (window.setRelStartPage)
        {
        setRelStartPage("index.htm");

                autoSync(1);
                sendSyncInfo();
                sendAveInfoOut();
        }
}
else
        if (window.gbIE4)
                document.location.reload();

//-->
//]]>
</script><span style="font-weight: bold; font-size: 10pt;"><font size="2" style="font-size:10pt;"><b><a href="http://www.opcfoundation.org" style="color: #0000ff; font-size: 10pt; text-decoration: underline;"><img src="opcfoundation.jpg" alt="opcfoundation.jpg" style="border: none;" width="189" height="61" align="left" border="0" /></a>The Interoperability Standard<br />
for Industrial Automation</b></font></span><br />
&#160;<br />
&#160;
<table cellspacing="0" width="100%" align="center">
<tr>
<td style="vertical-align: top;"><span style="font-size: 8pt;"><font size="1" style="font-size:8pt;"><a href="http://www.opcfoundation.org" target="_blank" style="color: #0000ff; text-decoration: underline;">OPC Foundation Online</a> | <a href="http://www.opcfoundation.org/certification" target="_blank">Certification</a> | <a href="http://www.opcfoundation.org/technology" target="_blank">Technology</a> | <a href="https://www.opcfoundation.org/news" target="_blank">News</a></font></span></td>
<td style="vertical-align: top; text-align: right; font-size: 8pt;"><a href="welcome.htm" style="color: #0000ff; text-decoration: underline;">Home</a> | <a href="getting_started.htm">Getting Started</a></td>
</tr>
</table>
<p style=" border-bottom:Solid 1px #000000; font-weight:bold; text-align:center; border-width:4px;"><span style="font-weight: bold; text-align: center;"><b><span style="font-weight: bold;"><b>Unified Architecture Technology Sample Applications</b></span></b></span></p>
<h1>Server Development Tutorial</h1>
<h2>Step 1 - Creating a new Server Project</h2>
<p>In this section you will copy an existing project, rename it, add it to the existing solution, and then rename all resources as appropriate.</p>
<ol type="1">
<li>
<p>Open Visual Studio .NET 2008 and then open the Sample Applications Source Code solution:<br />
<span style="font-family: 'Courier New', monospace;">OPC UA 1.02 .NET StackAndSamples [xxx]\UA Quickstart Applications.sln</span></p>
</li>
<li>
<p>We will now duplicate the Reference Server project:</p>
<ol type="1">
<li>
<p>Now switch to Windows Explorer.</p>
</li>
<li>
<p>Locate the "Reference Server" project, which is in the following default location:<br />
<span style="font-family: 'Courier New', monospace;">OPC UA 1.02 .NET StackAndSamples [xxx]\SampleApplications\Workshop\Reference</span></p>
</li>
<li>
<p>Right-click on the "Server" directory and choose Copy.</p>
</li>
<li>
<p>In the same "reference" folder you will right-click and then Paste.</p>
</li>
<li>
<p>A duplicate folder called "Server - copy" will be created. Rename this folder as appropriate.</p>
</li>
<li>
<p>Double-click the new folder to open it.</p>
</li>
<li>
<p>Rename the file "Reference Server.csproj" as appropriate, e.g. "MyServer".<br />
Note: this will <span style="text-decoration: underline;"><u>not</u></span> rename all resources as necessary.</p>
</li>
<li>
<p>Switch back to Visual Studio .NET 2008.</p>
</li>
</ol>
</li>
<li>
<p>Within this solution you can Add the project that you copied in the previous step:</p>
<ol type="1">
<li>
<p>Right-click on the Reference" folder that is visible within the Solution Explorer, choose Add Existing Project.</p>
</li>
<li>
<p>Using the navigation window locate, highlight, and select the *.csproj that you renamed in step 2.7 above.</p>
</li>
<li>
<p>The newly added project will be added to the solution and visible in the solution explorer.</p>
</li>
</ol>
</li>
<li>
<p>Now rename the remaining resources as appropriate:</p>
<ol type="1">
<li>
<p>Assembly name:</p>
<ol type="1">
<li>
<p>Open the properties of the newly added project.</p>
</li>
<li>
<p>Modify the "Assembly name", e.g. "Quickstarts.MyServer".</p>
</li>
<li>
<p>Modify the "Default namespace", e.g. "Quickstarts.MyServer".<br />
<br />
<span style="font-weight: bold;"><b>Note:</b></span> The removal of "Quickstarts." from the namespace will require additional work to help the compiler locate referenced classes; in some cases you will need to modify the "using" references to properly specify the locations of referenced classes.</p>
</li>
</ol>
</li>
<li>
<p>Product Renaming:</p>
<ol type="1">
<li>
<p>Within the current project, conduct a search and replace "ReferenceServer" with the intended name, e.g. "MyServer".</p>
</li>
<li>
<p>Again, within the same project conduct a search and replace "Reference Server" with the intended name, e.g. "My Server".</p>
</li>
<li>
<p>You may also with to rename the "OPC Foundation" branding as your own company, in which case simply search and replace ""OPC Foundation" (note the quote before OPC) with your company name, e.g. "My Company".</p>
</li>
<li>
<p>Rename the configuration file "Quickstarts.ReferenceServer.Config.Xml", e.g. "Quickstarts.MyServer.Config.Xml".</p>
</li>
</ol>
</li>
<li>
<p>Compile the application and run it to make sure that it opens and that the application name matches your expectations.</p>
</li>
<li>
<p>If you are an inquisitive person you might try connecting a UA Client to your newly created UA Server.</p>
</li>
</ol>
</li>
</ol>
<p>At this point you have created a clone of the <a href="overview_referenceserver.htm">Reference Server</a>. In the next section you will define the <a href="step_2_-_address_space.htm">address space</a>.</p>
<p style=" border-top:Solid 1px #000000; font-size:6pt; text-align:right; border-width:4px;"><span style="font-size: 6pt; text-align: right;"><font size="1" style="font-size:6pt;">Copyright OPC Foundation 1995-2013</font></span></p>
<script type="text/javascript" language="javascript1.2">
//<![CDATA[
<!--
if (window.writeIntopicBar)
        writeIntopicBar(0);


highlightSearch();
//-->
//]]>
</script>
</body>
</html>
